package com.example.demo.test.entity.many2oneboth;

import lombok.*;

import java.util.HashSet;
import java.util.Set;

/**
 * 双向多对一，与Order实现
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CustomerB {
    private Integer customerbId;
    private String customerbName;

    //要进行初始化，防止空指针异常
    //声明集合类型时使用接口类型，因为hibernate获取集合类型时，返回的是hibernate内置的集合类型
    private Set<OrderB> orderBs = new HashSet<>();
}
